/* Layout */
import Layout from '@neu/biz-core/layout'
import ParentView from '@neu/biz-core/components/ParentView'

export default [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        component: () => import('@neu/cmdb-ui/views/dashboard'),
        name: 'Dashboard',
        meta: { title: '仪表盘', icon: 'dashboard', affix: true, code: 'cmdb_menu_dashboard' }
      }
    ]
  },
  {
    path: '/cmdb',
    name: 'cmdb',
    redirect: '/cmdb/dashboard',
    alwaysShow: true,
    meta: {
      title: '配置库',
      icon: 'cmdb2',
      module: 'cmdb',
      code: 'cmdb_menu_dashboard' 
    },
    component: Layout,
    children: [
      {
        path: 'home',
        name: 'cmdb_home',
        meta: {
          title: '实例搜索',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_home' 
        },
        component: () => import('@neu/cmdb-ui/views/home')
      },
      {
        path: 'outline',
        name: 'cmdb_outline',
        meta: {
          title: '模型概要',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_outline' 
        },
        component: () => import('@neu/cmdb-ui/views/outline')
      },
      {
        path: 'categories',
        name: 'cmdb_categories',
        meta: {
          title: '分类管理',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_categories' 
        },
        component: () => import('@neu/cmdb-ui/views/categories')
      },
      {
        path: 'schemas',
        name: 'cmdb_schemas',
        meta: {
          title: '模型管理',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_schemas' 
        },
        component: () => import('@neu/cmdb-ui/views/schemas')
      },
      {
        path: 'schemas/:id',
        name: 'cmdb_schemas_edit',
        hidden: true,
        meta: {
          title: '模型详情',
          icon: 'right-arrow',
          module: 'cmdb',
          activeMenu: '/cmdb/schemas'
        },
        component: () => import('@neu/cmdb-ui/views/schemas/components/edit')
      },
      {
        path: 'instances',
        name: 'cmdb_instances',
        meta: {
          title: '实例管理',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_instances' 
        },
        component: () => import('@neu/cmdb-ui/views/instances')
      },
      {
        path: 'instances/:id',
        name: 'cmdb_instances_detail',
        hidden: true,
        meta: {
          title: '实例详情',
          icon: 'right-arrow',
          module: 'cmdb',
          activeMenu: '/cmdb/instances'
        },
        component: () => import('@neu/cmdb-ui/views/instances/components/edit')
      },
      {
        path: 'relationtypes',
        name: 'cmdb_relationtypes',
        meta: {
          title: '关联类型',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_relationtypes' 
        },
        component: () => import('@neu/cmdb-ui/views/relationtypes')
      },
      {
        path: 'relainsts',
        name: 'cmdb_relainsts',
        meta: {
          title: '关联关系',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_relainsts' 
        },
        component: () => import('@neu/cmdb-ui/views/relainsts')
      },
      {
        path: 'businesses',
        name: 'cmdb_businesses_model',
        meta: {
          title: '业务管理',
          icon: 'right-arrow',
          module: 'cmdb',
          code: 'cmdb_menu_businessemgr' 
        },
        component: ParentView,
        redirect: 'noRedirect',
        alwaysShow: true,
        children: [
          {
            path: 'businesses',
            name: 'cmdb_businesses',
            meta: {
              title: '业务模型',
              icon: 'right-arrow',
              module: 'cmdb',
              code: 'cmdb_menu_businesses' 
            },
            component: () => import('@neu/cmdb-ui/views/businesses')
          },
          {
            path: 'businesses/:id',
            name: 'cmdb_business_detail',
            hidden: true,
            meta: {
              title: '业务详情',
              icon: 'right-arrow',
              module: 'cmdb',
              activeMenu: '/cmdb/businesses'
            },
            component: () => import('@neu/cmdb-ui/views/businesses/components/edit')
          },
          {
            path: 'bizdef',
            name: 'cmdb_bizdef',
            meta: {
              title: '业务模型管理',
              icon: 'right-arrow',
              module: 'cmdb',
              code: 'cmdb_menu_bizdef' 
            },
            component: () => import('@neu/cmdb-ui/views/bizdef')
          },
          {
            path: 'bizdefs/:id',
            name: 'cmdb_bizdef_edit',
            hidden: true,
            meta: {
              title: '业务模型详情',
              icon: 'right-arrow',
              module: 'cmdb',
              activeMenu: '/cmdb/bizdefs'
            },
            component: () => import('@neu/cmdb-ui/views/bizdef/components/edit')
          },
          {
            path: 'bizs',
            name: 'cmdb_bizs',
            meta: {
              title: '业务实例管理',
              icon: 'right-arrow',
              module: 'cmdb',
              code: 'cmdb_menu_bizs' 
            },
            component: () => import('@neu/cmdb-ui/views/bizs')
          },
          {
            path: 'bizs/:id',
            name: 'cmdb_bizs_detail',
            hidden: true,
            meta: {
              title: '业务实例详情',
              icon: 'right-arrow',
              module: 'cmdb',
              activeMenu: '/cmdb/bizs'
            },
            component: () => import('@neu/cmdb-ui/views/bizs/components/edit')
          }
        ]
      }
    ]
  }
]
